package com.springcloud1.hystrixconsumer.microservice;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(value = "provider",fallback = ProviderHystrix.class)
public interface Provider {

//    @HystrixCommand(fallbackMethod = "ProviderHystrix.fallback")
    @GetMapping("/user")
    public String get();

    @GetMapping("/user/{name}")
    public String get(@PathVariable String name);

}
